<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="houtai_mainhead.jsp"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="statics/css/manage.css" type="text/css"></link>
<script src="statics/js/usermanage.js"></script>
<style type="text/css">
.get {
	text-align: center;
	margin-top: -580px;
	margin-left: 210px;
	width: 1150px;
	height: 500px;
}

#inputbox1 {
	background-color: white;
	text-align: center;
	margin-top: -100px;
	margin-left: -100px;
	width: 100%;
	height: 100%;
	z-index: 2px;
	border: 1px red solid;
	display: none;
}

button.search {
	width: 60px;
	height: 30px;
}

.yes {
	cursor: pointer;
}

.no {
	cursor: pointer;
} 
</style>
<script type="text/javascript">
	$(function() {
		$('.juti').on('click', '.yes', function() {
			var lei = $(this).attr('data-shuxing');
			$(this).attr('src', 'statics/image/yqs/no.gif');
			$(this).attr('class', 'no');
			var cid=$(this).attr('data-cid');
			$.post('carstorexiugai', {
				cid : cid,
				lei : lei,
				shu : 1
			}, function(data) {
			})
		})
		$('.juti').on('click', '.no', function() {
			var lei =$(this).attr('data-shuxing');
			$(this).attr('src', 'statics/image/yqs/yes.gif');
			$(this).attr('class', 'yes');
			var cid=$(this).attr('data-cid');
			$.post('carstorexiugai', {
				cid : cid,
				lei : lei,
				shu : 0
			}, function(data) {
			})
		})
	})
</script>
</head>

<body>

	<div class="handler">
		<form method="get">
			<input class="searchput" type="text" name="cno" placeholder="编号/名称查询">
			<button class="search">查询</button>
		</form>
		<button class="blueadd" id="delete" onclick="deletesome(3)">-删除</button>
		<button class="blueadd" onclick="javascript:window.location.href='carstorexiugai?pid=41'">+添加</button>
	</div>
	<div>${error}</div>
	<table class="juti">
		<thead>
			<tr>
				<th><input type="checkbox" onchange="checkAll(this)"
					class="all"></th>
				<th>编号</th>
				<th>名称</th>
				<th>价格</th>
				<th>精品</th>
				<th>新品</th>
				<th>热销</th>
				<th style="width: 20%">操作</th>
			</tr>
		</thead>

		<tbody>
			<c:forEach items="${Cars}" var="Car">
				<tr>
					<td><input type="checkbox" onchange="check()" id="${Car.cid }"></td>
					<td>${Car.cno}</td>
					<td>${Car.cname}</td>
					<td>${Car.cmoney}</td>

					<td>
						<c:if test="${Car.cJingpin==0}">
							 <img class="yes" 
							 	 data-shuxing="cjingpin"
								 data-cid="${Car.cid }" 
								 src="statics/image/yqs/yes.gif"> 
						</c:if>
						<c:if test="${Car.cJingpin==1}">
							<img class="no"
								 data-shuxing="cjingpin"
								 data-cid="${Car.cid }"
								 src="statics/image/yqs/no.gif"> 
						</c:if>
					</td>
					<td >
						<c:if test="${Car.cNew==0}">
							<img class="yes" 
								data-shuxing="cnew"
								data-cid="${Car.cid }" 
								src="statics/image/yqs/yes.gif" > 
						</c:if>
						<c:if test="${Car.cNew==1}">
							<img class="no" 
								data-shuxing="cnew"
								data-cid="${Car.cid }" 
								src="statics/image/yqs/no.gif"> 
						</c:if>
					</td>
					<td >
						<c:if test="${Car.cHot==0}">
								<img class="yes" 
									data-shuxing="chot"
									data-cid="${Car.cid }" 
									src="statics/image/yqs/yes.gif"> 
							</c:if>
						<c:if test="${Car.cHot==1}">
							<img class="no" 
								data-shuxing="chot"
								data-cid="${Car.cid }" 
								src="statics/image/yqs/no.gif"> 
						</c:if>
					</td>
					<td class="caozuo"> <a class="red"
						href="carstorexiugai?id=${Car.cid}&pid=4" id=${Car.cid }>更多修改</a>
					</td>

				</tr>

			</c:forEach>
		</tbody>
	</table>

	<div id="temp"></div>
</body>
</html>